home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Primer Plus
/
Java Primer Plus (Waite Group Proess)(1996).iso
/
chapter6
/
switch.java
< prev
next >
Wrap
Text File
|
1995-12-31
|
529b
|
25 lines
/* Switch statement example */
class switcher {
static public void main (String args[]) {
char c = 'o';
/* test the c variable */
switch (c) {
case 'a' : System.out.println("apple");
break;
case 'e' : System.out.println("eggplant");
break;
case 'i' : System.out.println("iris");
break;
case 'o' : System.out.println("orange");
break;
case 'u' : System.out.println("unyon");
break;
default : System.out.println("That is not a vowel");
}
}
}